import ajax from '../utils/axios'

export async function getContent(params) {
  const res = await ajax.get(`/api/content/list`, { params })
  return res.data.data
}

export async function deleteContent(ids) {
  const res = await ajax.post(`/api/content/delete?ids=${ids}`)
  return res.data.data
}

export async function createContent(params) {
  const res = await ajax.post(`/api/content/create`, params)
  return res.data.data
}

export async function updateContent(params) {
  const res = await ajax.post(`/api/content/update`, params)
  return res.data.data
}

export async function getGoodsContentReplyList(goodsId) {
  const res = await ajax.get(
    `/api/content/getGoodsContentReplyList?goodsId=${goodsId}`
  )
  return res.data.data
}

export async function getContentReply(userId) {
  const res = await ajax.get(
    `/api/content/getContentReplyList?userId=${userId}`
  )
  return res.data.data
}
